﻿using System;
using System.Web;
using System.Web.UI;
//using llano.web;
using CF.Data;
using CF.Service;

namespace CF.Web
{
    public partial class MyPage : Page
    {
        protected virtual string DoAction()
        {
            return "";
        }
        protected void PrintJson(string rt)
        {
            bool scriptTag = false;
            String cb = Request["callback"];
            if (cb != null)
            {
                scriptTag = true;
                Response.ContentType = "text/javascript";
            }
            else
                Response.ContentType = "application/x-json";

            if (scriptTag)
                rt = cb + "(" + rt + ")";

            Response.Write(rt);
            Response.End();
        }

        protected virtual string ReturnRT(string rt)
        {
            return rt;
        }


        //protected virtual string delstr(string rt)
        //{
        //    string startstr = "stcCallback1004";
        //    string endstr = "\"data\"";
        //    int StartPosition = rt.IndexOf(startstr);
        //    int EndPosition = rt.IndexOf(endstr);
        //    int DelLength = EndPosition - StartPosition;
        //    rt = rt.Remove(StartPosition, DelLength);
        //    return rt;
        //} 

      
        protected void Page_Load(object sender, EventArgs e)
        {
            PrintJson(DoAction());
        }
    }
}

 
